<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/8/11
 * Time: 18:54
 */
$技能 = $game->jn_get($arr_data->jnid);
var_dump($技能);
$链接_兑换 = $game->create_url("cmd=jninfo&canshu=duihuan&jnid={$技能->jnid}","兑换");
$htmltishi = '';
$玩家技能= $game->jn_get_player($arr_data->jnid);

$道具 = $game->dj_get_player($技能->jndj);
$道具_系统 = $game->dj_get_sys($技能->jndj);

if (!$道具){
    $道具->djsum = 0;
}

if (isset($arr_data->canshu)){
    switch ($arr_data->canshu){
        case 'duihuan':
            $ret = $game->dj_sub($道具_系统->djid , $技能->djcount);
            if ($ret){
                $game->jn_add($arr_data->jnid , 1);
                $htmltishi = "兑换成功<br/>";
                $玩家技能= $game->jn_get_player($arr_data->jnid);
                $道具 = $game->dj_get_player($技能->jndj);
            }else{
                $htmltishi = "道具数量不足<br/>";
            }

            break;
        case 'setjn1':
            $game->player_update_game1("jn1" , $arr_data->jnid );
            $htmltishi = "设置技能1成功<br/>";
            break;
        case 'setjn2':
            $game->player_update_game1("jn2" , $arr_data->jnid );
            $htmltishi = "设置技能2成功<br/>";
            break;
        case 'setjn3':
            $game->player_update_game1("jn3" , $arr_data->jnid );
            $htmltishi = "设置技能3成功<br/>";
            break;
    }


}

$dhhtml = "兑换需要：{$道具_系统->djname}({$道具->djsum}/{$技能->djcount}){$链接_兑换}<br/><br/>";
if ($玩家技能){
    $setjn1 = $game->create_url("cmd=jninfo&canshu=setjn1&jnid={$arr_data->jnid}","设置技能1");
    $setjn2 = $game->create_url("cmd=jninfo&canshu=setjn2&jnid={$arr_data->jnid}","设置技能2");
    $setjn3 = $game->create_url("cmd=jninfo&canshu=setjn3&jnid={$arr_data->jnid}","设置技能3");
    $dhhtml .="{$setjn1}{$setjn2}{$setjn3}<br/>";
}

?>
技能名称：<?php echo $技能->jnname; ?><br/>
攻击加成：<?php echo $技能->jngj; ?>%<br/>
防御加成：<?php echo $技能->jnfy; ?>%<br/>
暴击加成：<?php echo $技能->jnbj; ?>%<br/>
吸血加成：<?php echo $技能->jnxx; ?>%<br/>
<?php echo $htmltishi; ?>
<?php echo $dhhtml; ?>
<br/>
<?php echo $变量_系统->链接_返回游戏_按钮长;  ?><br/>
